<?php
/**
 * 系统权限表模型
 * 
 * @author:  will.lee <im.will.lee@gmail.com>
 * @version: 1.0
 */
class RoleNodeModel extends AppModel
{
    
    /**
     * 获取角色对应的权限ID
     */
    public function getRoleNodeIds($role_id)
    {
        $where  = array('role_id' => $role_id);
        $nodes  = $this->field('node_id')->where($where)->select();
        $return_nodes = array();
        if(!empty($nodes))
        {
            foreach($nodes as $node)
            {
                $return_nodes[] = $node['node_id'];
            }
        }
        return $return_nodes;
    }
}